<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>조립PC의 대명사- PC Master~!~!</title>

<style type="text/css">

a{text-decoration:none;color:red}
a:hover{color:#4C4C4C}
a:visited{color:#4C4C4C}
a:active{color:#4C4C4C}
</style>

<script>
	function search(){
		document.searchForm.action="/web/boardEvent/list";
		searchForm.submit();
	}
</script>
</head>
<body>

<!-- 상단 로그인 패널을 include로 삽입 -->
<div style="position:absolute; left:50%; top:0px; width:1200px; height:80px; margin-left:-600px;z-index:1 ">
<%@ include file="../loginPanel.jsp" %>
</div>

<!-- 상단 및 좌측 메뉴(카테고리)리스트를 include로 삽입 -->
<div style="position:absolute; left:50%; top:0px; width:1200px; height:80px; margin-left:-600px;">
<%@ include file="../top.jsp" %>
</div>

<div style="position:absolute; left:50%; top:160px; width:1000px; height:80px; margin-left:-400px;">
<!--------------------------------------여기다가 각자 삽입------------------------------------>

		<table style="margin-left:30px; margin-top:30px" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td><img src="/web/resources/images/bar_t_line.gif" border="0" alt="" /></td>
				<td style="color:333333;font-size:14px;font-weight:bold;">후기게시판</td>
			</tr>
		</table>
	<center>
      <table width="900px" border="0" cellspacing="0" cellpadding="0" style="margin-top:5px;">
        <tr>
          <td bgcolor="#333333" height="2"></td>
        </tr>
      </table>
		<table width="900px" border="0" cellspacing="0" cellpadding="0" style="margin-top:1;margin-bottom:1">
        <tr>
          <td bgcolor="f7f7f7" height="24">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr align="center">
                <td width="6%" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">번호</td>
                <td width="5%" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">첨부</td>
                <td style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">제 목</td>
                <td width="12%" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">작성자</td>
                <td width="12%" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">작성일</td>
                <td width="5%" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">조회수</td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
        <c:if test="${Pbeans.listcount==0}">
        	<br><br><br><br><br><br>
        	<td align="center">등록된 게시글이 없습니다!</td>
        	<br><br><br><br><br><br>
        </c:if>
        <c:if test="${Pbeans.listcount!=0}">
            <table width="900px" border="0" cellspacing="0" cellpadding="0">
              <c:forEach items="${list}" var="beans">
               <tr onMouseOver="this.style.backgroundColor='F0F0F0';" 
               	   onMouseOut="this.style.backgroundColor='';" bgcolor="FFFFFF">

                <td align="center" width="6%" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:11px;">
                ${beans.boardEvent_no}</td>
                <td align="center" width="5%" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:11px;">
                </td>
                <td align="left" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
				<a href="/web/boardEvent/detail?boardEvent_no=${beans.boardEvent_no}" style="cursor:hand">
				${beans.boardEvent_subject}</a></td>
                <td align="center" width="12%" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
				${beans.boardEvent_name}</td>
                <td align="center" width="12%" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
				${beans.boardEvent_date}</td>
                <td align="center" width="5%" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
				${beans.boardEvent_count}</td>
              </c:forEach>
            </table>
        </c:if>
      <br>
		<table width="900px">
			<tr>
				<c:if test="${user == 'admin'}">
				<td align="right">
					<input type="image" src="/web/resources/images/btn_write.gif" 
						   onclick="location.href='/web/boardEvent/writeForm'"/>
				</td>
				</c:if>
			</tr>
		</table>
      <table width="900px">
		<tr align="center">
		<c:if test="${Pbeans.listcount > 0}">
			<c:set var="pageCount" value="${count1}"/>
   			<c:set var="pageBlock" value="${10}"/>
   			<fmt:parseNumber var="result" value="${count2}" integerOnly="true" />
   			<c:set var="startPage" value="${result * 10 + 1}" />
   			<c:set var="endPage" value="${startPage + pageBlock-1}"/>
   		<c:if test="${endPage > pageCount}">
        	<c:set var="endPage" value="${pageCount}"/>
   		</c:if>
   		</c:if>
			<td>
				<c:if test="${startPage > 10}">
        			<a href="/web/boardEvent/list?page=${startPage - 10 }">[이전]</a>
				</c:if>

				<c:forEach var="i" begin="${startPage}" end="${endPage}">
					<font size="2"> <a href="/web/boardEvent/list?page=${i}">${i}|</a> </font>
   				</c:forEach>

				<c:if test="${endPage < pageCount}">
					<a href="/web/boardEvent/list?page=${startPage + 10}">[다음]</a>
				</c:if>
			</td>
		</tr>
      </table>
      <br>
      <form name="searchForm" method="post">
      <table width="300" border="0" cellspacing="0" cellpadding="0">
      	<tr>
      		<td>
      			<select name="searchType">
      				<option value="boardEvent_name">이름</option>
      				<option value="boardEvent_subject">제목</option>
      			</select>
      		</td>
      		<td>
      			<input type="text" name="keyword" style="border:1; color:#c0c0c0; height:15px;">
      		</td>
      		<td>
      			<input type="image" src="/web/resources/images/btn_find.gif" onclick="search()" style="border:0">
      		</td>
      	</tr>
      </table>
      </form>
      </center>
<!--------------------------------------   삽입 끝       ------------------------------------>
</div> 

<!-- 하단 이용약관, 고객센터, 회사정보 등의 정보를 include로 삽입 -->
<div style="position:absolute; left:0; top:1200px; width:100%; height:80px; ">
<%@ include file="../bottom.jsp"%>
</div>
</body>
</html>